package com.huawei.esdk.uc.sametime.util;

import com.ibm.collaboration.realtime.people.Person;

/**
 * 邀请与会人的辅助工具类
 * @author l00206777
 * 
 */
public class PersonInviteUtil
{

    private static PersonInviteUtil instance = new PersonInviteUtil();

    // 同时邀请多个人加入会议时候用来存储person的数组
    private Person[] selectedPerson;

    // 按单个号码邀请时候的号码
    private String numberToInvite;

    public static PersonInviteUtil getInstance()
    {
        return instance;
    }

    private PersonInviteUtil()
    {
        selectedPerson = null;
        numberToInvite = null;
    }

    public String getNumberToInvite()
    {
        return numberToInvite;
    }

    public void setNumberToInvite(String numberToInvite)
    {
        this.numberToInvite = numberToInvite;
    }

    public Person[] getSelectedPerson()
    {
        // return selectedPerson;
        Person[] personArray = null;

        if (null != this.selectedPerson)
        {
            int personCount = this.selectedPerson.length;
            if (personCount > 0)
            {
                personArray = new Person[personCount];
                for (int i = 0; i < personCount; i++)
                {
                    personArray[i] = this.selectedPerson[i];
                }
            }

        }
        return personArray;
    }

    public void setSelectedPerson(Person[] personArray)
    {
        if (null != personArray && personArray.length > 0)
        {
            this.selectedPerson = new Person[personArray.length];
            for (int i = 0; i < personArray.length; i++)
            {
                this.selectedPerson[i] = personArray[i];
            }
        }
    }

}
